//
//  StoreMenuView.h
//  ebook
//
//  Created by 吴超飞 on 16/3/8.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "StoreMenu.h"

#define kMenuHeight 44

@class StoreMenuView;
@protocol StoreMenuViewDelegate <NSObject>

-(void)storeMenuView:(StoreMenuView *)view didSelected:(StoreMenu *)menu;

@end

@interface StoreMenuView : UIView

@property (nonatomic, assign) NSInteger selectedIndex;
@property (nonatomic, assign) NSInteger lastSelectedIndex;
@property (nonatomic,weak) id<StoreMenuViewDelegate> delegate;

-(instancetype)initWithFrame:(CGRect)frame withMenuArray:(NSArray *)menu;

-(void)setSelectedButtonIndex:(NSInteger)index;//菜单切换
-(void)switchMenuIndex:(NSInteger)index;//只做菜单切换，不执行具体事件
-(StoreMenu *)currentMenu;//当前选中的菜单

//获取菜单的url
-(NSString *)originalUrlOfMenu:(NSInteger)index;

//根据序号模拟点击菜单
-(void)performClickBtn:(NSInteger)index;

@end
